package java9;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/4/17 11:07
 * 数列求和
 * https://www.nowcoder.com/practice/6893484c04c24bfca1f606b1823a468d?tpId=220&tqId=2109873&ru=%2Fexam%2Foj&qru=%2Fta%2Fprimary-grammar-java%2Fquestion-ranking&sourceUrl=%2Fexam%2Foj
 */
public class Main {

    public static void main(String[] args) {
        // 9 + 99 + 999 + ... + 9999999999
        long res = 0L;
        for (int i = 1; i <= 10; i++) {
            res += Math.pow(10, i) - 1;
        }
        System.out.println(res);
    }
}
